FROM fabric8/java-alpine-openjdk8-jdk

VOLUME /tmp

# 添加程序文件到容器
#COPY ../../../target/zy-java-template-1.0.0-SNAPSHOT.jar app.jar
#COPY ../resources/application.properties application.properties
#COPY ../resources/logback-spring.xml logback-spring.xml
#COPY ../resources/bootstrap.yml bootstrap.yml

COPY zy-java-template-1.0.0-SNAPSHOT.jar app.jar
COPY application.properties application.properties
COPY logback-spring.xml logback-spring.xml
COPY bootstrap.yml bootstrap.yml

# 设置 JAVA_OPS
ENV JAVA_OPTS="-Xms1024m -Xmx1024m -XX:MaxPermSize=256m -server -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=85 -XX:+DisableExplicitGC"

ENV Active="test"

ENV IP=""

ENV ZONE=""

# 日志文件
RUN ["/bin/mkdir", "-p", "/data/logs/"]

# 容器运行命令
ENTRYPOINT [ "sh", "-c", "java $JAVA_OPTS -jar app.jar --spring.profiles.active=$Active "]

# 端口暴露
EXPOSE 8888